/*! \file euler.cpp

\brief Ordinary differential equations solver with Taylors  1 degree expantion: euler

Date of creation: 2010-15-11

Copyright
Julian David Colorado, jd.colorado@upm.es
Universidad Politecnica de Madrid

See the file "license.terms" for information on usage and redistribution of this file, and for a
DISCLAIMER OF ALL WARRANTIES.
*/

#include "../dynlib.h"

/*
\brief Ordinary differential equations solver with Taylors  1 degree expantion: euler

Date of creation: 2007-02-03

INPUT:
\param MAT SimParam: Simulation Parameters 4 x 6
\param MAT X: State matrix 4 x pt
\param int i: Actual point
\param double u: Control action

OUTPUT:

\param MAT X: i+1 position modified.
*/
void odesolver(Matrix &SimParam,Matrix &X,int i,Matrix &u)
{
	//Ordinary differential equations solver with euler
	//INPUT:teta, dteta,i,step
	int j,fin;
	double tmp=0.0;
	fin=(int)(SimParam(4,4)+SimParam(4,3));
	ColumnVector temp(fin);
	
	odefunc(SimParam,X,i,u,i,temp);
	
	X.column(i+1)=X.column(i)+temp*SimParam(3,3);
	
}
